﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace crm_library.Extenstions
{
	public static class DropDownListExtensions
	{
		public static void SelectByValue(this DropDownList ddl, int selectedID = 0)
		{
			var selection = selectedID.ToString();

			foreach (ListItem item in ddl.Items)
			{
				item.Selected = item.Value.Equals(selection);
			}
		}
	}
}
